package com.feicheng.controller.wx;

import com.alibaba.fastjson.JSONObject;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.service.a.FFjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("/wx/room")
@RestController("/wx/room")
public class RoomController {

    @Autowired
    FFjService fjService;

    @PostMapping("/page")
    public ResultInfo getRoomByPage(@RequestBody JSONObject param) {
        return ResultInfo.success(fjService.getRoomsByPage(param));
    }

    @PostMapping("/list")
    public ResultInfo getRooms(@RequestBody JSONObject param) {
        return ResultInfo.success(fjService.getRooms(param));
    }

    @PostMapping("/info")
    public ResultInfo newFj(@RequestBody JSONObject param) {
        fjService.newRoom(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/info/get")
    public ResultInfo getRoom(@RequestBody JSONObject param) {
        param = fjService.getRoom(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/info/put")
    public ResultInfo updateRoom(@RequestBody JSONObject param) {
        param = fjService.updateRoom(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/temp")
    public ResultInfo temps(@RequestBody JSONObject param) {
        param = fjService.getprices(param);
        return ResultInfo.success(param);
    }



    @PostMapping("/pj/page")
    public ResultInfo getFjpjByPage(@RequestBody JSONObject param) {
        param = fjService.getPjBypage(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj/list")
    public ResultInfo getFjpjByList(@RequestBody JSONObject param) {
        param = fjService.getPjByList(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj")
    public ResultInfo newPj(@RequestBody JSONObject param) {
        param = fjService.pjRoom(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj/get")
    public ResultInfo getFjpj(@RequestBody JSONObject param) {
        param = fjService.getPjRoom(param);
        return ResultInfo.success(param);
    }


}
